using System;
using UnityEngine;

namespace GameCore
{
    public class FlowManager : MonoBehaviour
    {
        public IFlowSystem CurrentFlowSystem { get; private set; }

        public void ChangeFlow(IFlowSystem flowSystem)
        {
            CurrentFlowSystem?.OnExit();
            CurrentFlowSystem = flowSystem;
            CurrentFlowSystem.OnEnter();
        }

        public void Update()
        {
            CurrentFlowSystem?.OnUpdate();
        }
    }
}